#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

       int main(int argc, char **argv)
       {
           void *handle;
           double (*sinus)(double);
           char *error;

           handle = dlopen("libm.so", RTLD_LAZY);
           if (!handle) {
               fprintf(stderr, "%s\n", dlerror());
               exit(EXIT_FAILURE);
           }

          sinus = dlsym(handle, "sin");

           if ((error = dlerror()) != NULL)  {
               fprintf(stderr, "%s\n", error);
               exit(EXIT_FAILURE);
           }

           printf("%f\n", (*sinus)(90.0));
           dlclose(handle);
           exit(EXIT_SUCCESS);
           return 0;
       }
